<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
</head>
<body>
<div th:fragment="votes">
    <div class="alert alert-danger" th:if="${showAlertMessage}" th:utext="${showAlertMessage}">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    <div class="card border-dark mb-3 shadow-sm">
        <div class="card-header bg-secondary text-white">我的投票</div>
        <div class="card-body card-nopadding">
            <table class="do-table table table-hover" width='100%' border='0' cellspacing='0' cellpadding='0'
                   align='right'>
                <thead class="thead-light">
                <tr>
                    <th scope="col" style="width: 6%">序号</th>
                    <th scope="col" style="width: 20%">标题</th>
                    <th scope="col" style="width: 15%">时间</th>
                    <th scope="col" style="width: 10%">轮数</th>
                    <th scope="col" style="width: 35%">描述</th>
                    <th scope="col" style="width: 14%">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="vote : ${pager.votes}">
                    <th scope="row">
                        <p th:if="${voteStat.index} gt 9">
                            <span th:text="'0'+ (${voteStat.index}+1)"></span>
                        </p>
                        <p th:if="${voteStat.index} lt 9">
                            <span th:text="'00'+ (${voteStat.index}+1)"></span>
                        </p>
                    </th>
                    <td th:text="${vote.title}">--</td>
                    <td th:text="${#dates.format(vote.createDate, 'yyyy-MM-dd')}">--/--/--</td>
                    <td th:text="${vote.getItems().size()}">-</td>
                    <td th:text="${vote.body}">-</td>
                    <td>
                        <a class="btn btn-outline-primary btn-sm" style="float:left;" th:href="@{'/vote/' + ${vote.id}}"
                           role="button">进入</a>
                        <form action="#" th:action="@{'/vote/{id}'(id=${vote.id})}" th:method="delete"
                              style="float:left;padding-left: 10px;height: 10px">
                            <div class="form-group">
                                <button type="submit" class="btn btn-outline-danger btn-sm" th:text="删除">删除</button>
                            </div>
                        </form>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>